﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Aindex.aspx.cs" Inherits="pufflesweb.Aindex" %>
<%@ import Namespace="PBLL" %>
<%@ import Namespace="PDAL" %>
<%@ import Namespace="PModel" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>用户管理</title>
    
</head>
<body>
    


    <form id="form1" runat="server" >
        <div >
            <asp:Label ID="Label2" runat="server" Text="管理员："></asp:Label>
            <asp:Label ID="admin" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
            <table  width="800" align="center" border="1">
                <tr><td>用户账号</td><td>用户名</td><td>年龄</td><td>性别</td><td>邮箱</td><td>注册时间</td><td>地址</td><td>手机号</td><td>操作</td></tr>

                <%
                    string id = Request.QueryString["UID"];
                    if(id != null)
                    {
                        PBLL.User.del(int.Parse(id));
                        PF.JsHelper.AlertAndRedirect("删除成功","Aindex.aspx");
                    }

                    List<PModel.User> list = PBLL.User.list();
                    %>
                <% for (int i = 0; i < list.Count; i++)
                    {
                        string sex = "";
                        if(list[i].Usex == 0)
                        {
                            sex = "未知";
                        }
                        else if(list[i].Usex == 1)
                        {
                            sex = "男";
                        }
                        else
                        {
                            sex = "女";
                        }


                        %>

                <tr><td><%=list[i].UID%></td><td><% =list[i].Username%></td><td><%=list[i].Uage%></td><td><%=sex%></td><td><%=list[i].Uemail%></td><td><%=list[i].Utime%></td><td><%=list[i].Uaddress%></td><td>****</td><td><a href="Aindex.aspx?UID=<%=list[i].UID%>">删除</a></td></tr>
                <%} %>

            </table>
        </div>
    </form>
</body>
</html>
